/*
** my_getnbr.c for my_getnbr in /home/labonn_c//Documents/piscine/Jour_O4
** 
** Made by christophe labonnemartinez
** Login   <labonn_c@epitech.net>
** 
** Started on  Tue Oct 11 09:30:07 2011 christophe labonnemartinez
** Last update Tue Oct 25 16:14:44 2011 christophe labonnemartinez
*/

int     my_getnbr(char *str)
{
  int   res;

  if (*str == '-')
    return (-my_getnbr(str + 1));
  if (*str == '+')
    return (my_getnbr(str + 1));
  res = 0;
  while (*str >= '0' && *str <= '9')
    {
      res =res * 10;
      res = res + *str - '0';
      str = str + 1;
    }
  return (res);
}
